package com.gun.sqlSession;

import java.util.List;


/**
 * sql 会话对象
 */
public interface SqlSession {

    /**
     * 查询list
     * @param statementid
     * @param params
     * @param <E>
     * @return
     * @throws Exception
     */
    public <E> List<E> selectList(String statementid,Object... params) throws Exception;

    //根据条件查询单个
    public <T> T selectOne(String statementid,Object... params) throws Exception;

    /**
     * 为Dao接口生成代理实现类
     * <p>
     *     <pre>
     *         IUserDao userDao = sqlSession.getMapper(IUserDao.class);
     *
     *     </pre>
     * </p>
     * @param mapperClass 字节码文件对象
     * @param <T>
     * @return
     */
    public <T> T getMapper(Class<?> mapperClass);


}
